package com.cipta.lomob.model;

import java.io.Serializable;
import java.util.ArrayList;

public class ItemVideo implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	String title, description;
	int totalWatching;
	int totalLove = 0;
	Users users;
	int thumbnails;
	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public int getTotalWatching() {
		return totalWatching;
	}
	public void setTotalWatching(int totalWatching) {
		this.totalWatching = totalWatching;
	}
	public Users getUsers() {
		return users;
	}
	public void setUsers(Users users) {
		this.users = users;
	}
	public int getThumbnails() {
		return thumbnails;
	}
	public void setThumbnails(int thumbnails) {
		this.thumbnails = thumbnails;
	}
	
	public void setTotalLove(int count){
		this.totalLove = count;
	}
	
	public int getTotalLove(){
		return this.totalLove;
	}
	
	public static ArrayList<ItemVideo> getListVideo(String[][] data, int[] images){
		ArrayList<ItemVideo> listItemVideo = new ArrayList<ItemVideo>();
		ItemVideo itemVideo = null;
		for (int i = 0; i < data.length; i++) {
			itemVideo = new ItemVideo();
			itemVideo.setTitle(data[i][0]);
			itemVideo.setThumbnails(images[i]);
			itemVideo.setTotalWatching(Integer.valueOf(data[i][3]));
			
			Users users = new Users();
			users.setName(data[i][1]);
			users.setTotalFollowers(Integer.valueOf(data[i][2]));
			
			itemVideo.setUsers(users);
			
			listItemVideo.add(itemVideo);
		}
		
		return listItemVideo;
	}
}
